fix(dashboard): sort datasets by creation time (newest first)#6320
Conversation
Automated Reviewer SuggestionsBased on the
|
Align @if block indentation with the repo's prettier-eslint config to satisfy the frontend format:ci check. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (31.57%) is below the target coverage (60.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #6320 +/- ##
============================================
- Coverage 61.03% 61.01% -0.03%
Complexity 3378 3378
============================================
Files 1140 1140
Lines 44923 44932 +9
Branches 4942 4944 +2
============================================
- Hits 27419 27415 -4
- Misses 15992 16003 +11
- Partials 1512 1514 +2
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR fixes dataset listings being returned in an effectively undefined order by switching the default dataset sort to creation-time-desc (newest first) and preventing users from selecting sort options that would produce NULL-based ordering for datasets. It also makes the existing sort button reusable across resource types by allowing edit-time and execution-time options to be hidden.
Changes:
- Default dataset views (Your Work + Hub dataset view) to
SortMethod.CreateTimeDesc. - Add the shared sort button to the Your Work datasets page and align the utility controls layout with the workflows page.
- Make
SortButtonComponentconfigurable viashowEditTime/showExecutionTimeinputs and hide invalid options for datasets.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/app/hub/component/hub-search-result/hub-search-result.component.ts | Defaults Hub dataset view sorting to CreateTimeDesc when browsing datasets. |
| frontend/src/app/hub/component/hub-search-result/hub-search-result.component.html | Hides edit/execution sort options for dataset search results via SortButtonComponent inputs. |
| frontend/src/app/dashboard/component/user/user-dataset/user-dataset.component.ts | Defaults Your Work datasets sort to CreateTimeDesc and wires in SortButtonComponent import. |
| frontend/src/app/dashboard/component/user/user-dataset/user-dataset.component.html | Adds the sort button to the datasets page UI and groups it with view-mode controls. |
| frontend/src/app/dashboard/component/user/user-dataset/user-dataset.component.spec.ts | Adds/updates unit assertion for default dataset sort being CreateTimeDesc. |
| frontend/src/app/dashboard/component/user/sort-button/sort-button.component.ts | Adds showEditTime / showExecutionTime inputs to make sort options reusable per resource type. |
| frontend/src/app/dashboard/component/user/sort-button/sort-button.component.html | Conditionally renders edit/execution sort menu items based on the new inputs. |
| frontend/src/app/dashboard/component/user/sort-button/sort-button.component.spec.ts | Adds tests for the new inputs (needs stronger DOM-level assertions). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Xinyuan Lin <xinyual3@uci.edu>
Head branch was pushed to by a user without write access
What changes were proposed in this PR?
The Datasets listing did not show newly created datasets first — they appeared in an effectively undefined order.
Root cause: the datasets listing defaulted to
EditTimeDesc, but datasets have no "last modified" timestamp.DatasetSearchQueryBuildernever mapslastModifiedTime, so it falls back toNULLfor every dataset inUnifiedResourceSchema. The resultingORDER BY resourceLastModifiedTime DESC NULLS LASTties onNULLfor all rows, so the database returns datasets in an arbitrary order and creation time has no effect. The "Your Work" datasets pagealso had no sort control at all, so there was no way to notice or work around it. The Hub's dataset view shared the same latent bug.
This PR:
CreateTimeDesc(newest first) on both the "Your Work" datasets page and the Hub dataset view — datasets do have a populatedcreation_time.Create Dataset → [ Sort · List · Card ] → Filters).SortButtonComponentreusable by addingshowEditTimeandshowExecutionTimeinputs (both defaulttrue). Datasets have neither an edit nor an execution time, so those two options are hidden for datasets to prevent them from re-introducing theNULL-ordering behavior. Workflows, Search, and the Hub's workflow view are unchanged.No backend or schema changes.
Any related issues, documentation, discussions?
Closes #6215
How was this PR tested?
SortButtonComponent— new tests covering theshowEditTime/showExecutionTimeinputs and their defaults.UserDatasetComponent— asserts the default sort isCreateTimeDesc.sort-button8/8,user-dataset18/18).ng build) passes with no template/type errors.Screenshot shows the datasets page in Your Work section

Screenshot shows the datasets page in Hub's section

Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 4.8)